Add vocabulary relating to proposals, intentions and measures. #579
Add vocabulary relating to proposals, intentions and measures. #579scammo wants to merge 15 commits intofedify-dev:mainfrom
Conversation
Summary of ChangesHello @scammo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces new vocabulary types for economic resource coordination, specifically Proposal, Intent, and Measure, based on FEP-0837. This is a great addition that will enable building federated marketplace applications with Fedify.
The implementation is well-done, with new YAML definitions for the vocabulary generator and corresponding test snapshot updates. I have a few minor suggestions to improve the changes:
- In
CHANGES.md, please add your name to the changelog entry as per the contribution guidelines and remove an unused reference link. - In
packages/vocab/src/measure.yaml, thehasNumericalValueproperty should use a numeric type (xsd:float) instead ofxsd:stringfor better type safety and interoperability.
Thank you for your contribution, especially as a first-time contributor! These changes are valuable to the project.
# Conflicts: # CHANGES.md # packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snap # packages/vocab-tools/src/__snapshots__/class.test.ts.node.snap # packages/vocab-tools/src/__snapshots__/class.test.ts.snap
|
FYI: I updated the comments, CHANGES.md and the snapshots to the current version :) |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
|
FYI: I resolved the conversation and I created a new enhencement issue #617 |
|
@dahlia Thank you for all your suggestions and for your patience regarding this matter. I have done my best to resolve all issues. If you notice anything that needs improving before these changes are merged, please let me know. |
dahlia
left a comment
There was a problem hiding this comment.
Thanks for the updates. I'm still blocking on a few remaining issues: Proposal needs to preserve inherited Object term mappings in its context, the generated snapshot files currently contain unresolved merge markers and appear to be breaking the snapshot CI, and Measure.hasNumericalValue should now move from xsd:string to xsd:decimal since decimal support landed in #640. Please address the inline comments and then I'll take another look.
📝 WalkthroughWalkthroughThe changes add three new vocabulary types to the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGES.md`:
- Line 23: Change the ATX heading "### `@fedify/vocab`" to the file's setext style
to satisfy markdownlint MD003: replace the line "### `@fedify/vocab`" with a
setext underline version using a dash/equals underline matching the other
headings in CHANGES.md (e.g., "@fedify/vocab" followed by a line of "-" of
similar length) so the heading style matches the project's configured markdown
style.
In `@packages/vocab/src/proposal.yaml`:
- Around line 20-24: Add a regression test that serializes a Proposal containing
embedded Intent and Measure and snapshots the resulting JSON-LD to detect
context-compaction drift; construct a Proposal instance with nested Intent and
Measure values, run it through the same JSON-LD serialization/compaction
entrypoint used by the codebase (e.g., the project’s toJsonLd/compactJsonLd
helper that handles Proposal), and assert the output includes the full context
mappings (action, resourceConformsTo, hasUnit, etc.); name the test clearly
(e.g., "Proposal nested context compaction snapshot") so CI will catch
accidental drift of the duplicated context mappings for Proposal/Intent/Measure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 3ee63d70-2c21-42f2-aaed-c985b960284c
⛔ Files ignored due to path filters (4)
packages/vocab-tools/src/__snapshots__/class.test.ts.deno.snapis excluded by!**/*.snappackages/vocab-tools/src/__snapshots__/class.test.ts.node.snapis excluded by!**/*.snappackages/vocab-tools/src/__snapshots__/class.test.ts.snapis excluded by!**/*.snappackages/vocab/src/__snapshots__/vocab.test.ts.snapis excluded by!**/*.snap
📒 Files selected for processing (6)
CHANGES.mddocs/manual/vocab.mdpackages/vocab/src/intent.yamlpackages/vocab/src/measure.yamlpackages/vocab/src/proposal.yamlpackages/vocab/src/vocab.test.ts
|
@dahlia Thank you again for your suggestions and hard work! The whole topic is more complex than I initially hoped, but I hope the changes I've made are useful. If you think any further improvements are needed, please let me know! :) |
Summary
Add vocabulary relating to proposals, intentions and measures according to the docs.
Related issue
Reference the related issue(s) by number, e.g.:
Changes
Benefits
Users can now build a federated system based on the first part of FEP-0837: Federated Marketplace (https://codeberg.org/fediverse/fep/src/branch/main/fep/0837/fep-0837.md). This is really interesting for making offered goods or services available for discovery in the Fediverse.
Checklist
mise teston your machine?Additional notes
Please note that this is both my first pull request and my first enhancement issue for this project. While I have extensive Mastodon/event experience, I have no prior experience of enhancing federation tooling directly. I am happy to make any necessary changes or additions. Thank you for your work!